#include "StdAfx.h"
#include "MyControl.h"



MyControl::MyControl(void)
{
	m_pAo = NULL;
	m_presentDirectory = "C:\\";
}


MyControl::~MyControl(void)
{
	if(m_pAo != NULL)
	{
		delete m_pAo;
		m_pAo = NULL;
	}
}


void MyControl::Run(const char* command,int& oderNum,MyString& path)
{
	

	
	m_pAo = new Analyze_Oder;
	m_pAo->SetUserOder(command);
	m_pAo->Analysis();

	MyString OderName;
	MyString *OderParameter;

	m_pAo->GetOder(OderName,OderParameter);

	oderNum=m_od.Command(OderParameter,OderName);

	m_pAo->GetPath(path);


	delete []OderParameter;
	OderParameter = NULL;
	delete m_pAo;
	m_pAo = NULL;

	
}
MyString MyControl::GetDirectory()
{
	return m_presentDirectory;
}

void MyControl::SetDirectory(const MyString& presentDirectory)
{
	m_presentDirectory = presentDirectory;
}
void MyControl::DisplayDirectory()
{
	m_presentDirectory.Display();
	cout <<">";
}